﻿@model MAPDavy.WebMVC3.ViewModels.TermGradesViewModel 

@{
    ViewBag.Title = "ChooseSection";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section JavaScript{
    <script src="@Url.Content("~/Scripts/jquery.ui.accordion.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.ui.selectable.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            
            $("#accordion").accordion({
                autoHeight: false,
                navigation: true
            });

            $(".selectable li").hover(
              function () {
                  $(this).addClass("ui-state-highlight");
              },
              function () {
                  $(this).removeClass("ui-state-highlight");
              }
            );
        });
    </script>
}
@section Css{
    <style>
	    .selectable .ui-selecting { background: #FECA40; }
	    .selectable .ui-selected { background: #F39814; color: white; }
	    .selectable { list-style-type: none; margin: 0; padding: 0; width: 100%; }
	    .selectable li { margin: 3px; padding: 0.5em; font-size: 1.2em; height: 32px; }
	    .container {margin:auto; width: 30%; }
    </style>
}
<div class="cpanel ui-widget ui-widget-content ui-corner-all">
    @Html.HiddenFor(model => model.Term.Id  ) 
    @Html.HiddenFor(model => model.Term.Anio )  
    <table class="toolbar">
        <tr>
            <td valign="middle" >
                <img src="@Url.Content("~/Content/images/selectSeccion.png")" alt="evaluaciones" />
            </td>
            <td class="tdHeader">
                <span class="header">Evaluación: @Html.DisplayFor(model => model.Term.NameTerm )</span>
            </td>
            <td><center>
                <a href="@Url.Action("Index", "Term")">
                    <img src="@Url.Content("~/Content/images/back.png")" title="Candelar" alt="Candelar" />
                    <br /><span class="label">Cancelar</span>
                </a></center>
            </td>
        </tr>
    </table>
</div>
<div class="container">
    <div id="accordion">
       @foreach (var item in Model.Grades)
       {
            <h3><a href="#">Grade: @Html.DisplayFor(modelItem => item.GradeLevel)</a></h3>
	        <div>
                @foreach (var seccion in item.Seccions )
                {
                    if (seccion.SeccionTutors.Where(st => st.Anio.Equals(@Request.Cookies["workspace"].Value.ToString())).SingleOrDefault() != null)
                    {
                        <ol class="selectable">
                        <li class="ui-widget-content ui-corner-all">
                            <table class="selectRit">
                                <tr>
                                    <td class="label" valign="top">
                                        <b>Class Name:</b> @Html.DisplayFor(modelItem => seccion.ClassName)
                                    </td>
                                    <td valign="top">
                                        <a href="@Url.Action("RegistarRit", "Score", new { termId = Model.Term.Id, seccionId = seccion.Id })">
                                        <img src="@Url.Content("~/Content/images/regRit.png")" title="Registrar Puntajes" alt="Registrar Puntajes" /></a>
                                    </td>
                                </tr>
                            </table>
                        </li> 
                    </ol>
                    }
                }		        
	        </div>
       }        
    </div>
</div>



